package common

import (
	"net/http"
	"bytes"
	"encoding/json"
	"fmt"
)

func Data() (value map[string]interface{}){
	params:=make(map[string]interface{})
	params["jsonrpc"] = "2.0"
	params["id"] = 88
	return params
}

func Direct(params map[string]interface{}) (resp *http.Response){
	data,_:=json.Marshal(params)
	fmt.Println("1)传递的参数为:",string(data))
	resp, _ = http.Post("https://ropsten.infura.io/IY77yuopq4bSgHoaFqJe", "application/json", bytes.NewBuffer(data))
	return
}


type Result struct {
	Id int `json:"id"`
	Jsonrpc string `json:"jsonrpc"`
	Res string `json:"result"`
}